package com.wyc.apidriver.service.impl;

import com.wyc.apidriver.feign.OrderFeignClient;
import com.wyc.apidriver.service.ApiOrderService;
import com.wyc.internalCommon.request.OrderInfo;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApiOrderServiceImpl implements ApiOrderService {

    @Autowired
    private OrderFeignClient orderFeignClient;

    /**
     * 司机出发去接乘客
     * @param orderInfo
     * @return
     */
    @Override
    public ApiResult toPickUpPassenger(OrderInfo orderInfo) {
        return orderFeignClient.toPickUpPassenger(orderInfo);
    }

    /**
     * 司机到达上车地点
     * @param orderId
     * @return
     */
    @Override
    public ApiResult driverArrivedDeparture(Long orderId) {
        return orderFeignClient.driverArrivedDeparture(orderId);
    }

    /**
     * 司机接到乘客
     * @param orderInfo
     * @return
     */
    @Override
    public ApiResult pickUpPassenger(OrderInfo orderInfo) {
        return orderFeignClient.pickUpPassenger(orderInfo);
    }

    /**
     * 乘客下车，行程结束
     * @param orderInfo
     * @return
     */
    @Override
    public ApiResult passengerGetoff(OrderInfo orderInfo) {
        return orderFeignClient.passengerGetoff(orderInfo);
    }

    /**
     * 取消订单
     * @param orderId
     * @param identity 取消人的身份标识（1.乘客 2.司机3.平台）
     * @return
     */
    @Override
    public ApiResult cancelOrder(Long orderId, String identity) {
        return orderFeignClient.cancelOrder(orderId,identity);
    }
}
